<template>
	<view class="home">
		<!-- <view class="row" v-for="(item,index) in listArr" :key="index">
			<image class="logo" :src="item.picurl"></image>
			<view class="">{{item.title}}</view>
		</view> -->

		<view class="home">
			<view class="out" v-for="item in listArr" :key="item.id">
				<view class="row">
					姓名：{{item.name}}
				</view>
			</view>
		</view>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				listArr: [],
				userArr: []
			}
		},
		onLoad() {
			uniCloud.callFunction({
				name: "myCloudFun",
				data: {
					num: 5
				}
			}).then(res => {
				this.listArr = res.result
				console.log(this.listArr);
			})
			// this.getDataBase()
			this.getData()
		},
		methods: {
			getData() {
				uniCloud.callFunction({
					name: "cloudDemoGet",
					data: {
						keyword: "空"
					}
				}).then(res => {
					console.log("返回的数据信息res是", res);
					this.listArr = res.result.data
				})
			},
			// 获取云函数数据表中的数据
			getDataBase() {
				uniCloud.callFunction({
					name: "cloudDemo1",
					data: {}
				}).then(res => {
					console.log('返回的res数据信息是', res);
					this.userArr = res.result?.data
				})
			}

		}
	}
</script>

<style lang="scss">
	.out {
		padding: 30rpx;

		.row {
			border-bottom: 1px solid #ccc;
			padding: 20rpx 0;
		}
	}
</style>